package config

import (
	"github.com/go-playground/validator/v10"
	"github.com/spf13/viper"
)

var validate = validator.New()

func InitConfig(env string) {
	viper.AddConfigPath("./conf")
	viper.SetConfigType("yaml")
	initSetting()
	initEnv(env)
}

func read(s, t interface{}) {
	k := "temp"
	v := viper.New()
	v.Set(k, s)
	err := v.UnmarshalKey(k, t)
	if err != nil {
		panic(err)
	}
}
